<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="app">
    Hello
  </div>
  <script>
    const data = {
      msg: 'Hello'
    }
    const vm = {}
    Object.defineProperty(vm, 'msg', {
      get() {
        console.log('get:', data.msg);
        return data.msg
      },
      set(newValue) {
        console.log('set:', newValue);
        data.msg = newValue
        document.querySelector('#app').textContent = data.msg
      }
    })
    vm.msg = 'Hello W'
    console.log(vm)
    const aa = {}
    console.log(aa);
  </script>
</body>

</html>